package interaction.sampling.matching;

import interaction.sampling.Sample;
import interaction.sampling.SampleSet;

public class SoundLevelMatcher implements Matcher {
	public double match(Sample test, SampleSet comparison) {
		double testLevel = test.getSum() / test.size();
		double comparisonLevel = comparison.getSampleAverage().getSum() / test.size();
		return -Math.abs(testLevel - comparisonLevel)/comparisonLevel;
	}
	
	public double getAcceptanceTreshold() {
		return -0.3;
	}
}
